import Grunt
import Battlespace
from common import *

class Move(object):
    def __init__(self, grunt, newcoords):
        assert isinstance(grunt, Grunt.Grunt)
        self.grunt = grunt
        self.newcoords = newcoords
    def apply(self, battlespace):
        assert isinstance(battlespace, Battlespace.Battlespace)
        battlespace.place(self.grunt, self.newcoords)
    
class TakeDamage(object):
    def __init__(self, grunt, amount):
        self.grunt = grunt
        self.amount = amount
    def apply(self, battlespace):
        self.grunt.HP -= self.amount
        #print '%s took damage %d, new hp %d' % (self.grunt.name, self.amount, self.grunt.HP)
        
class PerformAttack(object):
    def __init__(self, grunt):
        self.grunt = grunt
    def apply(self, battlespace):
        pass